package com.hzxy.yiyid.web.module.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.hzxy.yiyid.web.module.repository.entity.ExigencyKnowleges;
import com.hzxy.yiyid.web.module.repository.entity.OldArticle;
import com.hzxy.yiyid.web.module.repository.entity.YongerArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageArticleMapper extends BaseMapper<YongerArticle> {

    @Select("select id from science where science_name = #{classfyName}")
    Integer getClassifyId(String classfyName);

    @Select("select * from yonger_article where science_id = #{id}")
    List<YongerArticle> selectAllYonById(Integer id);

    @Select("select * from old_article where science_id = #{id}")
    List<OldArticle> selectAllOldById(Integer id);

    @Select("select * from exigency_knowleges where science_id = #{id}")
    List<ExigencyKnowleges> selectAllExiById(Integer id);

    @Select("select * from exigency_knowleges where id = #{id}")
    ExigencyKnowleges getExigencyKnowleges(Integer id);

    @Select("select * from yonger_article where id = #{id}")
    YongerArticle getYongerArticle(Integer id);

    @Select("select * from old_article where id = #{id}")
    OldArticle getOldArticle(Integer id);
}
